import 'dart:io';

import 'package:dbio_utils/fasta/indexed_fasta.dart';
import 'package:dbio_utils/generic_filehandle/local_file.dart';
import 'package:flutter_test/flutter_test.dart';

import 'package:dbio_utils/dbio_utils.dart';

void main() {
  test('adds one to input values', () {
    final calculator = Calculator();
    expect(calculator.addOne(2), 3);
    expect(calculator.addOne(-7), -6);
    expect(calculator.addOne(0), 1);
    expect(() => calculator.addOne(null), throwsNoSuchMethodError);
  });

  test('read fai file', () async {
    LocalFile fasta = LocalFile(File('/Users/leeo/Downloads/big_demo/ghl_demo_fasta.fasta'));
    LocalFile fai = LocalFile(File('/Users/leeo/Downloads/big_demo/ghl_demo_fasta.fasta.fai'));
    var indexedFasta = IndexedFasta(fasta: fasta, fai: fai);
    var idxMap = await indexedFasta.indexes;

    Map<String, IndexEntry> nameEntries = idxMap['name'];
    print(nameEntries);

    var seq = await indexedFasta.getResiduesByName('1', 0, 200);
    print(seq);

    print(await indexedFasta.sequenceList);
  });
}
